package com_.dxy_test_.value_transfer_;


/**
 * @Description 值传递测试
 * @Author dangxianyue
 * @Date 2022/10/12 10:01
 */
public class ValueTransferTest {
    public static void main(String[] args) {
        Person person = new Person("张三");
        makeItNull(person);//复制传递person的地址
        if (person == null) {
            System.out.println("person is null! ");
        } else {
            System.out.println("person is not null! ");
        }
    }

    //person is not null!

    private static void makeItNull(Person person) {
        person = null;
    }


}

class Person {
    private String name;

    public Person(String name) {
        this.name = name;
    }
}